/** 获取当前请求对应的 route 配置
 *
 * @param {*} router defineRouter 解析后的路由配置
 * @param {*} reqLocation useRequestLocation 返回的地址对象
 * @param {*} strict 是否严格匹配 "/" 结尾
 * @return 返回对应的 route 配置
 */
export function useCurrentRoute(router, reqLocation, strict) {
    const { pathname } = reqLocation;
    let route = router[pathname];
    if (!strict && !router) {
        if (pathname.endsWith("/")) {
            route = router[pathname.replace(/\/$/, "")];
        }
        else {
            route = router[`${pathname}/`];
        }
    }
    return route;
}
